import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { QuestionaireLogVO, QuestionaireLogForm, QuestionaireLogQuery } from '@/api/stroke/questionaireLog/types';

/**
 * 查询问卷日志列表
 * @param query
 * @returns {*}
 */

export const listQuestionaireLog = (query?: QuestionaireLogQuery): AxiosPromise<QuestionaireLogVO[]> => {
  return request({
    url: '/stroke/questionaireLog/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询问卷日志详细
 * @param id
 */
export const getQuestionaireLog = (id: string | number): AxiosPromise<QuestionaireLogVO> => {
  return request({
    url: '/stroke/questionaireLog/' + id,
    method: 'get'
  });
};

/**
 * 新增问卷日志
 * @param data
 */
export const addQuestionaireLog = (data: QuestionaireLogForm) => {
  return request({
    url: '/stroke/questionaireLog',
    method: 'post',
    data: data
  });
};

/**
 * 修改问卷日志
 * @param data
 */
export const updateQuestionaireLog = (data: QuestionaireLogForm) => {
  return request({
    url: '/stroke/questionaireLog',
    method: 'put',
    data: data
  });
};

/**
 * 删除问卷日志
 * @param id
 */
export const delQuestionaireLog = (id: string | number | Array<string | number>) => {
  return request({
    url: '/stroke/questionaireLog/' + id,
    method: 'delete'
  });
};
